<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<script type="text/javascript">
		//<![CDATA[
		//debe usarse los \\:  en lugar de : en los selectores de JQuery
		$(document).ready(function() {
			wizardSetCurrentPageStyle('form_wizard:associativityDataB');
		});
		//]]>
	</script>
</h:head>
<h:body>
	<h:form id="form_associativity2_data">
		<h2>
			<h:outputLabel value="#{i18n['lbl.owner.associativity.title']} 2" />
		</h2>

		<div class="clearfix common-panel">
			<div class="ui-form-row-2col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.associativity2.work_associativity']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneRadio
							value="#{aSession.selectedRuatRegister.workingInPartnership}"
							id="radioWorkingInPartnership">
							<f:selectItem itemLabel="Si" itemValue="1" />
							<f:selectItem itemLabel="No" itemValue="2" />
							<f:ajax event="click" render="workAsso" />
						</p:selectOneRadio>
					</div>
				</div>
				<div class="ui-form-col"></div>
			</div>
			<p:panel id="workAsso">
				<div class="ui-form-row-2col clearfix">
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel value="#{i18n['lbl.owner.associativity2.name']}" />
						</div>
						<div class="clearfix text-align-left">
							<p:inputText
								value="#{aSession.selectedRuatRegister.associateName}"
								id="associateNameId"
								required="#{aSession.selectedRuatRegister.workingInPartnership==1}"
								disabled="#{aSession.selectedRuatRegister.workingInPartnership==2}" />
						</div>
					</div>
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel
								value="#{i18n['lbl.owner.associativity2.confidence_grade']}" />
						</div>
						<div class="clearfix text-align-left">

							<p:selectOneMenu
								value="#{aSession.selectedRuatRegister.confidenceGrade}"
								id="confidenceGradeCmb" required="#{aSession.selectedRuatRegister.workingInPartnership==1}" disabled="#{aSession.selectedRuatRegister.workingInPartnership==2}">
								<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
									itemValue="" noSelectionOption="true" />
								<f:selectItems
									value="#{confidenceGradeCmb.parameterDTO.options}" />
							</p:selectOneMenu>

						</div>
					</div>

				</div>
				<div class="ui-form-row-2col clearfix">
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel
								value="#{i18n['lbl.owner.associativity2.last_name']}" />
						</div>
						<div class="clearfix text-align-left">
							<p:inputText
								value="#{aSession.selectedRuatRegister.associateLastName}"
								id="associateLastNameId"
								required="#{aSession.selectedRuatRegister.workingInPartnership==1}"
								disabled="#{aSession.selectedRuatRegister.workingInPartnership==2}" />
						</div>
					</div>
					<div class="ui-form-col"></div>
				</div>
				<div class="ui-form-row-2col clearfix">
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel
								value="#{i18n['lbl.owner.associativity2.farm_village']}" />
						</div>
						<div class="clearfix text-align-left">
							<p:inputText
								value="#{aSession.selectedRuatRegister.associateVillage}"
								id="associateVillageId"
								required="#{aSession.selectedRuatRegister.workingInPartnership==1}"
								disabled="#{aSession.selectedRuatRegister.workingInPartnership==2}" />
						</div>
					</div>
					<div class="ui-form-col"></div>

				</div>
			</p:panel>
		</div>
		<div class="clearfix common-panel">
			<div class="ui-form-row-2col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.associativity2.lbl_followed']}" />
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="#{i18n['lbl.owner.associativity2.product']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneMenu
							value="#{aSession.selectedRuatRegister.followProduct}">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" />
							<f:selectItems
								value="#{followProductAsociativityCmb.parameterDTO.options}" />
						</p:selectOneMenu>
					</div>
				</div>
			</div>
			<div class="ui-form-row-2col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.associativity2.followed_name']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:inputText value="#{aSession.selectedRuatRegister.followName}"
							required="true" />
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.associativity2.frequency']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneMenu
							value="#{aSession.selectedRuatRegister.frequencyOfConsultation}"
							required="true">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" noSelectionOption="true" />
							<f:selectItems
								value="#{frequencyOfConsultationCmb.parameterDTO.options}" />
						</p:selectOneMenu>
					</div>
				</div>
			</div>
			<div class="ui-form-row-2col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.associativity2.followed_lastname']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:inputText
							value="#{aSession.selectedRuatRegister.followLastName}"
							required="true" />
					</div>
				</div>
				<div class="ui-form-col"></div>

			</div>
		</div>

		<div class="buttons-container clearfix text-align-right">
			<p:commandButton value="#{i18n['lbl.flow_button.cancel']}"
				styleClass="ui-flowbutton"
				oncomplete="currentPage('list_owner_data.xhtml')"
				actionListener="#{stepByStepController.cancelRuatRegister}" />
			<p:commandButton value="#{i18n['lbl.flow_button.back']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" update="form_associativity2_data"
				actionListener="#{stepByStepController.viewAssociativityData}" />
			<p:commandButton value="#{i18n['lbl.flow_button.save_and_next']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" validateClient="true"
				update="form_associativity2_data"
				actionListener="#{stepByStepController.viewFarmData}"		 
				id="savenext" />
		</div>
		<p:blockUI block="savenext" trigger="savenext" />
	</h:form>
</h:body>
<script type="text/javascript">
	//<![CDATA[
	//debe usarse los \\:  en lugar de : en los selectores de JQuery

	//]]>
</script>
</html>